﻿//Project: CassiniWrapper
//Martin CLAVREUIL
//martin@clavreuil.com

using System;
using System.Collections.Generic;
using System.IO;
using System.Windows.Forms;

namespace CassiniWrapper
{
    static class Program
    {
        /// <summary>
        /// Program entry-point
        /// </summary>
        [STAThread]
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            if (args.Length == 1)
            {
                if (File.Exists(CassiniWrapper.Properties.Settings.Default.CassiniEXEPath))
                {
                    //Program starts
                    MainForm form = new MainForm();
                    form.TargetFolderPath = args[0];
                    Application.Run(form);
                }
                else
                {
                    //Invalid Cassini executable path
                    MessageBox.Show(Languages.Languages.GetString("ERR_NoCassini"), Languages.Languages.GetString("FORM_Caption"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                //No argument suplied : Error message + usage
                MessageBox.Show(Languages.Languages.GetString("ERR_NoParameter"), Languages.Languages.GetString("FORM_Caption"), MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
    }
}
